<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>ShreeConsultancy</title>
<script type="text/javascript">
function checklogin()
{
	var username = document.forms[0].username.value;
	var password = document.forms[0].password.value;
	if(username == "")
	{
		alert("Username cannot be empty");
		document.forms[0].username.focus();
	}else if(password == "") {
		alert("Password cannot be empty");
		document.forms[0].password.focus();
	}else{
		document.forms[0].submit();
	}	
}
</script>
</head>
<body>
<form action="LoginServlet" name="LoginForm" method="post">
<%String errorMessage = (String)request.getAttribute("error");
  String userName = (String)request.getAttribute("username");
  userName = userName!=null?userName:"";
%>
<table align="center">
	<tr>
		<td align="left"><img src="images\LOGO1.png" align="left"></td>
	
	</tr>
</table>
<table align="center">
	<tr>
		<td>
			<%if( errorMessage != null && !errorMessage.isEmpty()){ %>
				<font style="font-family: cursive;font-size: large;color: red"><%=errorMessage%> </font>
			<%} %>
		</td>
	</tr>
</table>
<br>
<table align="center" border="2">
	<tr>
		<td align="right"><label>UserName:</label>  </td>
		<td align="right">
			<input type="text"
				   id="username" 
				   name="username"
				   value="<%=userName%>"/>
		</td>
	</tr>
	<tr>
		<td align="right"><label>Password:</label> 
		</td>
		<td>
			<input type="password"
				   id="password" 
				   name="password" />
		</td>
	</tr>
	<tr>
		<td colspan="2" align="right">
			<input type="button" name="button"
			onclick="checklogin();" value="Login" />
		</td>
	</tr>
</table>
</form>
</body>
</html>